<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
	<head>
		<link href="<c:url value="/resources/bootstrap/css/bootstrap.min.css" />" rel="stylesheet">
		<script src="<c:url value="/resources/jquery/jquery-2.1.1.min.js" />"></script>
		<script src="<c:url value="/resources/bootstrap/js/bootstrap.min.js" />"></script>
		<script type="text/javascript">
			var login = function(){
				var username = $('#username').val();
				var password = $('#password').val();
				var form = $('form');
				if(username && password){
					form.attr("action", "loginProcess");
					form.submit();
				}else{
					alert("Username or password can't be empty");
				}
			};
			$(function(){
				document.onkeydown = function(e){
				    var ev = document.all ? window.event : e;
				    if(ev.keyCode==13) {
				    	login();
				     }
				};
			});   
		</script>
	</head>
	<body>
		 <div class="col-md-4 col-md-offset-4"> 
		   <div class="navbar navbar-inverse navbar-fixed-top" >
				<div class="container-fluid">
					<div class="navbar-header">
						<a class="navbar-brand" href="#">查车信息</a>
					</div>
				</div>
		   </div> 
		   
		   <div style="padding-top:100px;">
		    	<c:if test="${not empty SPRING_SECURITY_LAST_EXCEPTION}">
				   <div class="panel panel-default">
					  	<div class="panel-body" style="color:red;">
						     <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}"/>.
					  	</div>
					</div>
				</c:if>
				
			   
		    	
			    <form class="form-horizontal" method="post">
				    <fieldset>
					    <div class="form-group text-center">
					    	<label class="control-label col-sm-4">Username</label>
					    	<div class="col-sm-6">
					    		<input type="text" class="form-control form-group" id="username" name="j_username" placeholder="用户名">
							</div>
						</div>
						<div class="form-group">	
					    	<label class="control-label col-sm-4">Password</label>
					    	<div class="col-sm-6">
					    		<input type="password" class="form-control form-group" id="password" name="j_password" placeholder="密码">
							</div>
					    </div>
			       		<div class="form-group">
			       			<div class="col-sm-6 col-sm-offset-6">
				       			<a class="btn btn-default" onclick="login()">Login</a>
			       			</div>
			       		</div>
		           </fieldset>
			   </form> 
		   </div>
		</div>
	</body>
</html>


